package com.koala.learn.threadlearn.test;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

/**
 * @Description TODO
 * @Date 2022/3/20 19:35
 * @Created by koala
 */

public class Start2 {

    private static final Integer MAX = 100;

    public static void main(String[] args) throws InterruptedException {
        Counter counter = new Counter(0);
        ExecutorService executorService = Executors.newFixedThreadPool(9);
        for (int i = 0; i < 10; i++) {
            executorService.submit(counter);
        }
        executorService.awaitTermination(1, TimeUnit.SECONDS);
        System.out.println(counter.getCount());

    }
}
